![]() |
FSWrite |
||||
Header: | Files.h | Carbon status: | Supported | |
Writes any number of bytes to an open file.
OSErr FSWrite ( SInt16 refNum, SInt32 *count, const void *buffPtr );
The file reference number of an open file.
On input, a pointer to the number of bytes to write to the file; on output, a pointer to the number of bytes actually written.
A pointer to the data buffer from which the bytes are to be written.
A result code.
The FSWrite function takes the specified number of bytes from the specified data buffer and attempts to write them to the specified file. Because the write operation begins at the current mark, you might want to set the mark first by calling the SetFPos function.
If the write operation completes successfully, FSWrite moves the file mark to the byte following the last byte written and returns noErr. If you try to write past the logical end-of-file, FSWrite moves the logical end-of-file. If you try to write past the physical end-of-file, FSWrite adds one or more clumps to the file and moves the physical end-of-file accordingly.
The low-level functions PBWriteSync and PBWriteAsync let you set the mark without having to call SetFPos
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)